<template>
  <!-- 查看早班会记录 -->
  <base-breadcrumb>
    <div class="page-body" v-loading="loading">
      <a-card :bordered="false">
        <title-name title="信息详情" />
        <a-form-model :model="formInfo">
          <a-row :gutter="24">
            <a-col :md="8" :sm="8">
              <a-form-model-item label="班组" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <span>{{ formInfo.teamName }}</span>
              </a-form-model-item>
            </a-col>
                        <a-col :md="16" :sm="16">
                          <a-form-model-item label="所属单位" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                            <span>{{ formInfo.viewName }}</span>
                          </a-form-model-item>
                        </a-col>
<!--            <a-col :md="8" :sm="8">-->
<!--              <a-form-model-item label="所属项目" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">-->
<!--                <span>{{ formInfo.projectName }}</span>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
<!--            <a-col :md="8" :sm="8">-->
<!--              <a-form-model-item label="所属分公司" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">-->
<!--                <span>{{ formInfo.branchComName }}</span>-->
<!--              </a-form-model-item>-->
<!--            </a-col>-->
          </a-row>
          <a-row :gutter="24">
            <a-col :md="8" :sm="8">
              <a-form-model-item label="班组长" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <span>{{ formInfo.teamLeader }}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="日期" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <span>{{ formInfo.morningTime }}</span>
              </a-form-model-item>
            </a-col>
            <a-col :md="8" :sm="8">
              <a-form-model-item label="作业部位" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <span>{{ formInfo.workPart }}</span>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="24">
            <a-col :md="24" :sm="24">
              <a-form-model-item label="照片" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <upload-list
                  :businessCode="'SHE07'"
                  :editModel="0"
                  :uploadArrys.sync="formInfo.fileInfoVOList"
                  uploadType="image"
                  multiple
                ></upload-list>
              </a-form-model-item>
            </a-col>
          </a-row>
          <a-row :gutter="24">
            <a-col :md="24" :sm="24">
              <a-form-model-item label="视频" :labelCol="{ lg: { span: 6 }, sm: { span: 6 } }">
                <video style="margin-right: 20px;height: 250px; "
                       v-for="file in formInfo.videoList"
                       controls
                       :src="$fileUrl2(file)"
                ></video>
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </a-card>
      <div class="tool-btns page-btn-right-top">
        <a-button type="primary" @click="handleClose">关闭</a-button>
      </div>
    </div>
  </base-breadcrumb>
</template>

<script>
import UploadList from '@/components/UploadList'
import { getMeetingRecordDetail } from '@/api/safetySupervision/morningMeeting.js'

export default {
  name: 'a' + Date.now(), components: {
    UploadList
  },
  data() {
    return {
      pageType: 'look',
      formInfo: {
        viewName: ""
      },
      loading: false
    }
  },
  created() {
    this.getDetail()
  },
  methods: {
    async getDetail() {
      const { id } = this.$route.query
      if (!id) return
      const params = {
        id
      }
      this.loading = true
      const [err, res] = await getMeetingRecordDetail(params)
      this.loading = false
      if (!err) {
        this.formInfo = {
          ...res.data
        }
        this.formInfo.viewName = this.formInfo.branchComName + '/' + this.formInfo.projectName
      }
    },
    handleClose() {
      this.$multiTab.close(this.$route.fullpath)
    }
  }
}
</script>

<style lang="less" scoped>
@deep: ~'>>>';
.page-body {
  .ant-radio-group {
    width: 100%;
  }

  form .ant-mentions,
  form textarea.ant-input {
    height: auto !important;
    width: 100%;
  }
}

.tool-btns {
  display: flex;
  justify-content: flex-end;

  @{deep} .ant-btn + .ant-btn {
    margin-left: 12px;
  }
}
</style>
